<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %>
<%@ include file="/resources/modular/plugin/taglibs.jsp" %>
<!doctype html>
<head content="-我的">
    <%@ include file="/resources/modular/head/inside_head.jsp" %>
</head>
<body class="GC_Menu_7" name="GC_indvidual">

<%@ include file="/resources/modular/plugin/mainMenu.jsp" %>

<div class="page" name="GC_individual_changeloginpassword">

    <%@ include file="/resources/modular/plugin/mainTopMenu.jsp" %>

    <%@ include file="/resources/modular/plugin/individualMeun.jsp" %>

    <div class="page_right">
        <%@ include file="/resources/modular/plugin/SecuritityGetMobileCode.jsp" %>

        <div class="my_accountSafe_setloginpsd_dv" id="GC_securitity_next" style="display: none;">
            <p>
                <span>旧密码：</span>
                <input type="password" id="oldpassword" placeholder="请输入旧密码">
                <span>*密码错误</span>
            </p>
            <p>
                <span>新密码：</span>
                <input type="password" id="newpassword" placeholder="请输入新密码">
                <span>*密码错误</span>
            </p>
            <p>
                <span>确认密码：</span>
                <input type="password" id="confirmpassword" placeholder="请再次输入新密码">
                <span>*密码错误</span>
            </p>
            <p class="my_accountSafe_settel_next_losepoint">修改登录密码失败</p>
            <div class="my_accountSafe_confirmdv"><a class="my_accountSafe_setloginpsd_confirmbtn" href="javascript:;">确认</a>
            </div>
        </div>

    </div>

</div>
<%@ include file="/resources/modular/plugin/SecuritityResultPromptBox.jsp" %>
</body>
</html>
<%@ include file="/resources/modular/foot/inside_footer.jsp" %>
<script type="text/javascript" src="${basePath}resources/js/v2/youyicloud-md5.js"></script>
<script>



    var clickChangeFlag = false;

    function changPassword() {
        if (clickChangeFlag) {
            alert("不能重复点击");
            return false;
        }

        var mobilecode =  $(".my_accountSafe_codeinput").val();
        var oldpassword = $("#oldpassword").val();
        var newpassword = $("#newpassword").val();

        $.ajax({
            url: '${basePath}v2/individual/changloginpassword',
            type: 'POST',
            data: {
                "mobileCode": mobilecode,
                "oldpassword": createPassword(oldpassword, oldpassword),
                "newpassword": createPassword(newpassword, newpassword)
            },
            error: function (response) {
                $errorMsg(response);
            },
            success: function (ret) {
                if (ret.result) {
                    clickChangeFlag = true;
                    $(".my_accountSafe_settel_next_losepoint").hide();
                    $(".pointpage_beginpsd").html("修改登录密码成功");
                    $(".pointpage_dv1").show();
                } else {
                    $(".pointpage_dv1").hide();
                    $(".my_accountSafe_settel_next_losepoint").html(ret.info).show();
                }
            }
        });
        /*if(newpassword != confirmpassword){
         $(".my_accountSafe_settel_next_losepoint").html("两次密码不一致").show();
         }else if(oldpassword == newpassword){
         $(".my_accountSafe_settel_next_losepoint").html("旧密码与新密码不能一致").show();
         }else{  }*/

    }

</script>